/* 侧边栏基本样式 */
.sidebar {
    width: 250px;
    height: calc(100vh - 60px);
    background-color: #2E5AAC;
    padding: 1rem 0;
    overflow-y: auto;
    position: fixed;
    top: 60px;
    bottom: 0;
    left: 0;
    z-index: 998;
    list-style: none;
    flex-direction: column;
    overflow-y: visible;
    color: white; /* 侧边栏文字颜色设为白色 */
}

/* 菜单项样式 */
.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.5rem;
    display: flex;
    flex-direction: column;
}

.sidebar .menu-item {
    display: block;
    padding: 0 1rem;
    position: relative;
}

.sidebar .menu-item span {
    display: block;
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: white; /* 菜单项文字颜色设为白色 */
    transition: background-color 0.3s;
}

.sidebar .menu-item span:hover {
    background-color: rgba(255, 255, 255, 0.1); /* 鼠标悬停时的半透明背景 */
}

/* 二级菜单 */
.sidebar .sub-menu {
    left: 100%;
    top: 0;
    min-width: 200px;
    display: none;
    z-index: 1001;
}

/* experiment.css */
.sidebar .sub-item {
    position: relative; /* 关键修复 */
    min-width: 100px;
}

.sidebar .menu-item:hover .sub-menu {
    display: flex !important;
}

/* 二级菜单项 */
.sidebar .sub-menu li {
    padding: 0;
}

.sidebar .sub-menu li span {
    padding: 0.75rem 1rem;
    color: white; /* 二级菜单项文字颜色设为白色 */
}

.sidebar .sub-menu li span:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 三级菜单 */
.sidebar .third-menu {
    position: absolute;
    left: 100%;
    right: auto;
    top: 0;
    background-color: #2E5AAC; /* 与侧边栏背景色一致 */
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    width: 200px; /* 设置为与侧边栏宽度一致 */
    min-width: 200px; /* 确保最小宽度与侧边栏一致 */
    z-index: 1002;
    display: none;
    flex-direction: column;
    max-width: 200px;
    color: white; /* 三级菜单文字颜色设为白色 */
}

.sidebar .sub-item:hover .third-menu {
    display: flex;
}

/* 三级菜单项 */
.sidebar .third-menu li {
    padding: 0;
}

.sidebar .third-menu li a {
    display: block;
    padding: 0.75rem 1rem;
    color: white; /* 三级菜单项文字颜色设为白色 */
    text-decoration: none;
    transition: background-color 0.3s;
}

.sidebar .third-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* 展开的子菜单样式 */
.sidebar .menu-item.active .sub-menu {
    display: flex; /* 确保激活状态下显示子菜单 */
}

.sidebar .sub-item.active .third-menu {
    display: flex; /* 确保激活状态下显示三级菜单 */
}

